package com.loong.experiment02.config;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

@Component
@ConfigurationProperties(prefix = "student")
@Validated
public class StudentConfig {
    private Student student;

    public Student getStudent() {
        return student;
    }

    public void setStudent(Student student) {
        this.student = student;
        System.out.println("Student set: " + student);
    }

    // 添加初始化方法进行调试
    public StudentConfig() {
        System.out.println("StudentConfig initialized");
    }
}
